package com.crm.service.impl.worklog;

import com.crm.dao.mapper.customMapper.worklog.WorkLogCustomMapper;
import com.crm.dao.mapper.worklog.WorkLogMapper;
import com.crm.model.entity.worklog.WorkLog;
import com.crm.model.qo.worklog.WorkLogQO;
import com.crm.model.vo.worklog.WorkLogQueryVO;
import com.crm.service.worklog.WorkLogDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * @Description: 工作日志
 * @Author lixq-f
 * @Date 2021/6/25
 * @Version V1.0
 **/
@Service
public class WorkLogDbServiceImpl implements WorkLogDbService {

    @Autowired
    private WorkLogMapper workLogMapper;
    @Autowired
    private WorkLogCustomMapper workLogCustomMapper;

    @Override
    public List<WorkLogQueryVO> selectWorkLogListByPage(WorkLogQO workLogQO, String order) {
        return workLogCustomMapper.selectWorkLogListByPage(workLogQO, order);
    }

    @Override
    public Boolean addWorkLog(WorkLog workLog) {
        return workLogMapper.insert(workLog) > 0;
    }

    @Override
    public Boolean updateWorkLog(WorkLog workLog) {
        return workLogMapper.updateByPrimaryKeySelective(workLog) > 0;
    }

    @Override
    public Boolean deleteById(String logId) {
        return workLogCustomMapper.deleteByLogId(logId);
    }


    @Override
    public WorkLogQueryVO getLogById(String logId) {
        return workLogCustomMapper.getLogById(logId);
    }


}
